<template>
  <div>
    <span>{{ goodsName }}</span>
    <!-- 给增加按钮绑定点击事件 -->
    <button @click="addFn(ind)">+</button>

    <span>{{ count }}</span>
    <!-- 给删除按钮绑定点击事件 -->
    <button @click="subFn(ind)">-</button>
  </div>
</template>

<script>
export default {
  props: ["goodsName", "ind", "count"],
  methods: {
    addFn(ind) {
      this.$emit("add", ind);
    },
    subFn(ind) {
      this.$emit("sub", ind);
    },
  },
};
</script>

<style>
</style>